<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<table @click="editItem($event)">
				<tr>
					<th>序号</th>
					<th>名称</th>
					<th>价格</th>
					<th>操作</th>
				</tr>
					<tr v-for="(goods,index) in goodslists">
						<td>{{index+1}}</td>
						<td>{{goods.name}}</td>
						<td>{{goods.price}}</td>
						<td><a href="#" :dataname="goods.name" >编辑</a></td>
					</tr>
			</table>
		</div>
		<script src="./node_modules/vue/dist/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			let app=new  Vue({
				el:"#app",
				data:{
					goodslists:[
						{name:'p40',price:4180},
						{name:'iphone se',price:3299},
						{name:'魅族16Xs AI',price:1499},
					]
					
				},methods:{
					editItem(e){
						console.log(e);
					}
				}
			})
		</script>
	</body>
</html>
